package fristphase.day9_13;

import java.util.Scanner;

public class 邮件格式验证 {
    public static void main(String[] args) {
        String regex = "[a-zA-Z0-9]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";
        System.out.println("请输入邮箱：");
        String email = new Scanner(System.in).nextLine();
        if(email.matches(regex)){
            System.out.println("right");
        }else {
            System.out.println("请输入正确格式的邮箱");
        }
    }
}
